<template>
    <div class="cms-service">
        <div class="service-title">找专业的人，做专业的事</div>
        <div v-for="item in serviceData" class="service-content">
            <div class="office-content " @mouseenter="activeOfficeContent = item.id" :class="{activeOfficeContent:(item.id == activeOfficeContent)}">
                <div class="service-con-icon"><img :src="item.serviceImage"></div>
                <div class="service-con-text">
                    <p class="service-con-title">{{item.serviceTitle}}</p>
                    <div class="service-con-content">
                        {{item.serviceContent}}
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>

    import serviceApi from '@/api/serviceApi'

    export default {
        name: "CmsService",
        data(){
            return{
                activeOfficeContent:'',
                serviceData:[]
            }
        },
        methods:{
        },
        created:async function () {
            let res = await serviceApi.serviceDetail();
            if(res.code == '200'){
                this.serviceData = res.data
            }
        }
    }
</script>

<style scoped>
    .cms-service{
        text-align: center;
        max-width:1540px;
        width: 100%;
        /*margin: 0 auto;*/
        margin-left: 10%;
        margin-bottom: 80px;
        float: left;
        height: auto;
    }
    .service-title{
        margin-top: 80px;
        font-size: 36px;
        color: #ff7908;
    }
    .service-content{
        width: 33.3%;
        height: 500px;
        float: left;
        margin-top: 100px;
    }

    .office-content{
        width: 80%;
        margin-left: 10%;
        height: 100%;
        border-radius: 10px;
        box-shadow: 2px 2px 30px #e0e0e0;
        background-color: #FFFFFF;
        cursor: pointer;
    }
    .activeOfficeContent{
        transition-delay: 0.12s;
        background-color: #ffa867;
        color: #FFFFFF;
    }
    .service-con-icon{
        width: 80px;
        height: 80px;
        margin-left:40%;
        margin-top: 80px;
        float: left;
    }
    .service-con-icon > img{
        width: 100%;
        height: 100%;
    }
    .service-con-text{
        float: left;
        width: 100%;
        height: 280px;
        margin-top: 20px;
    }
    .service-con-title{
        font-size: 22px;
    }
    .service-con-content{
        text-align: left;
        margin-top: 20px;
        padding-left: 60px;
        padding-right: 60px;
    }
</style>